package com.gec.common;

/**
 * <p>
 *  保存和获取当前登录用户id
 * </p>
 *
 * @author : [chenxys]
 * @version : [v1.0]
 * @createTime : [2022/7/4 19:28]
 */
public class BaseContext {
    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    /**
     * 获取值
     */
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    /**
     * 获取值
     */
    public static Long getCurrentId(){
        return threadLocal.get();
    }
}
